﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Rtgs.master" AutoEventWireup="true" CodeFile="followup_incoming_repairlist.aspx.cs" Inherits="followup_incoming_repairlist" %>

<%@ Register Src="~/usercontrol/searching.ascx" TagPrefix="uc" TagName="searching" %>


<asp:Content ID="ctnBody" ContentPlaceHolderID="body" runat="server">

    <link type="text/css" rel="stylesheet" href="<%= ResolveClientUrl("~/css/ui.jqgrid.css") %>" />
    
    <script type="text/javascript" src="<%= ResolveClientUrl("~/script/i18n/grid.locale-en.js") %>"></script>
    <script type="text/javascript" src="<%= ResolveClientUrl("~/script/jquery.jqGrid.min.js") %>"></script>
    
    <script src="<%= ResolveClientUrl("~/script/helper.js") %>" type="text/javascript"></script>

	<div>
	<%--<a href="#" id="dialog_link" class="dialog_link ui-state-default ui-corner-all" alt="Add" onclick="OpenForm('add')"><span class="ui-icon ui-icon-plus"></span>Add</a>
	<a href="#" id="dialog_link" class="dialog_link ui-state-default ui-corner-all" alt="Edit" onclick="OpenForm('edit');"><span class="ui-icon ui-icon-pencil"></span>Edit</a>
--%>	<a href="#" id="dialog_link" class="dialog_link ui-state-default ui-corner-all" alt="Delete" onclick="OpenForm('delete');" ><span class="ui-icon ui-icon-trash"></span>Delete</a>
    </div>
    
           
    <br />
    
    <table id="table" class="scroll" cellpadding="0" cellspacing="0"></table>
    <div id="pager" class="scroll"></div>
     
    <br />
    
    <div id="dialog" title="Default dialog">
    </div>
                
    <script type="text/javascript">

        var handlerUrl = '<%= ResolveClientUrl("~/ajaxhandler/stp_record_detail_i.ashx") %>';

        $('#table').jqGrid({
            url: handlerUrl + '?method=getdata&status=repair',
            datatype: 'json',
            colNames: ['Record Type', 'Transaction Code', 'BOR', 'URN Info','Auth Error','OSN','From Member','To Member'],
            colModel: [
           		{ name: 'recordDetailItrRecordtype', hidden: false, index: 'RECORD_DETAIL_ITR_RecordType', width: 150 },
           		{ name: 'recordDetailItrTransactioncode', index: 'RECORD_DETAIL_ITR_TransactionCode', width: 150 },
           		{ name: 'recordDetailItrBor', index: 'RECORD_DETAIL_ITR_BOR', width: 150 },
                { name: 'recordDetailItrUrninfo', index: 'RECORD_DETAIL_ITR_URNInfo', width: 150 },
                { name: 'recordDetailItrAutherrorflag', index: 'RECORD_DETAIL_ITR_AuthErrorFlag', width: 150 },
                { name: 'recordDetailItrOsn', index: 'RECORD_DETAIL_ITR_OSN', width: 150 },
                { name: 'recordDetailItrFrommember', index: 'RECORD_DETAIL_ITR_FromMember', width: 150 },
                { name: 'recordDetailItrTomember', index: 'RECORD_DETAIL_ITR_ToMember', width: 150 }

           	],
            rowNum: 10,
            id: 'RECORD_DETAIL_ITR_RecordType',
            multiselect: true,
            rowList: [5, 10, 15, 20],
            pager: '#pager',
            sortname: 'RECORD_DETAIL_ITR_RecordType',
            sortorder: "asc",
            viewrecords: true,
            jsonReader: { repeatitems: false },
            width: 'auto',
            height: '100%',
            caption: 'Incoming Repair',
            ajaxGridOptions: { cache: false },
            ondblClickRow: function () {
                //OpenForm('edit');
            }
        });

        function OpenForm(ctl) {

            var grid = $("#table");
            var selIds = grid.jqGrid('getGridParam', 'selarrrow'),
                selText = [];
            $.each(selIds, function () {
                selText.push(grid.jqGrid('getCell', this, 'menuId'));
            });

            if (ctl == "edit") {
                $("#dialog").load('../../form/usermanagement/sys_t_menuform.aspx?id=' + selText).dialog({ autoOpen: false, modal: true, width: 400, title: 'Edit Menu' });
                $("#dialog").dialog('open');
            }
            else if (ctl == "add") {
                $("#dialog").load('../../form/usermanagement/sys_t_menuform.aspx').dialog({ autoOpen: false, modal: true, width: 400, title: 'Add Menu' });
                $("#dialog").dialog('open');
            }
            else {
                var result = window.confirm('Are you sure that you want to delete?');
                if (result) {
                    CallAjax("../../ajaxhandler/usermanagement/sys_t_menu.ashx", "?method=delete" + "&id=" + selText);

                    setTimeout("$('#table').trigger('reloadGrid');", 3000);
                }
            }

        }
    
    </script>
    
   
    
</asp:Content>

